package org.htmlparser.tags;

import java.util.Locale;
import org.htmlparser.Node;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.SimpleNodeIterator;

public class FrameSetTag extends CompositeTag
{
  private static final String[] mEndTagEnders;
  private static final String[] mIds;

  static
  {
    String[] arrayOfString1 = new String[1];
    arrayOfString1[0] = "FRAMESET";
    mIds = arrayOfString1;
    String[] arrayOfString2 = new String[1];
    arrayOfString2[0] = "HTML";
    mEndTagEnders = arrayOfString2;
  }

  public String[] getEndTagEnders()
  {
    return mEndTagEnders;
  }

  public FrameTag getFrame(String paramString)
  {
    return getFrame(paramString, Locale.ENGLISH);
  }

  public FrameTag getFrame(String paramString, Locale paramLocale)
  {
    FrameTag localFrameTag = null;
    String str = paramString.toUpperCase(paramLocale);
    SimpleNodeIterator localSimpleNodeIterator = getFrames().elements();
    while (true)
    {
      do
      {
        Node localNode;
        do
        {
          if ((!(localSimpleNodeIterator.hasMoreNodes())) || (localFrameTag != null))
            break label76;
          localNode = localSimpleNodeIterator.nextNode();
        }
        while (!(localNode instanceof FrameTag));
        localFrameTag = (FrameTag)localNode;
      }
      while (localFrameTag.getFrameName().toUpperCase(paramLocale).equals(str));
      localFrameTag = null;
    }
    label76: return localFrameTag;
  }

  public NodeList getFrames()
  {
    return getChildren();
  }

  public String[] getIds()
  {
    return mIds;
  }

  public void setFrames(NodeList paramNodeList)
  {
    setChildren(paramNodeList);
  }

  public String toString()
  {
    return "FRAMESET TAG : begins at : " + getStartPosition() + "; ends at : " + getEndPosition();
  }
}